<?php

class PointsAction extends CommonAction {

    public function _initialize() {

        $this->initCommon();

    }
	
    public function online(){
        $pagesize = 10;
        $map='member_id = '.$this->memberInfo['id'];
        if($_REQUEST['find_time']){
            $map.=' and time between '.strtotime(date('Y-m-d',strtotime($_REQUEST['find_time']))).' and '.(strtotime(date('Y-m-d',strtotime($_REQUEST['find_time'])))+86400);
        }
        $count=D('Integral_log')->where($map)->count();
        import ( 'ORG.Util.Page' );
        $p=new Page($count,$pagesize);
        $this->list = D('Integral_log')->where($map)->order('time desc')->limit($p->firstRow.','.$p->listRows)->select();
        $this->pages = $p->show();
        $this->display();
    }
    public function offline(){
        $this->online();
    }
	
	public function Points_list(){
		$pagesize = 10;
        $map='member_id = '.$this->memberInfo['id'];
        if($_REQUEST['find_time']){
            $map.=' and time between '.strtotime(date('Y-m-d',strtotime($_REQUEST['find_time']))).' and '.(strtotime(date('Y-m-d',strtotime($_REQUEST['find_time'])))+86400);
        }
        $count=D('Points_log')->where($map)->count();
        import ( 'ORG.Util.Page' );
        $p=new Page($count,$pagesize);
        $this->list = D('Points_log')->where($map)->order('time desc')->limit($p->firstRow.','.$p->listRows)->select();
		$now=0;
		foreach($this->list as $k => $v){
		$list[$k]=$v;
		$now+=$v['total'];
		//$list[$k]['now']=$now;	
		}
		$this->list=$list;
        $this->pages = $p->show();
		
		$this->display();
	}

}

